package com.autumn.jvm.gc;

/**
 * @author: Autumn
 * @describe: 三色标记的简易代码
 * @date: 2022/10/13 0013
 * @modified By:
 */
public class ThreeColorRemark {
    public void main(String[] args) {
        A a = new A();
        //开始做并发标记
        D d = a.b.d;    //1、读
        a.b.d = null;   //2、写
        a.d = d;        //3、写
    }

    class A {
        B b = new B();
        D d = null;
    }

    class B {
        C c = new C();
        D d = new D();
    }

    class C {
    }

    class D {
    }
}
